Author Topic: glError 1281 exception  (Read 2905 times)

Offline Redman

  • byte
  • *
  • Posts: 28
    • View Profile
glError 1281 exception
« on: July 15, 2016, 06:14:53 pm »
I'm getting this really strange crash exception from jPCT-AE.  I'm manually creating a bunch of Object3D's...  and it all renders fine, unless I translate the Object3D z position <= -16.0f, in which case I get this exception:

07-15 12:09:49.709 423-454/com.xxxxxxxxxx I/jPCT-AE: Creating buffers...
07-15 12:09:49.710 423-454/com.xxxxxxxxxx E/jPCT-AE: [ 1468598989710 ] - ERROR: before: glError 1281
07-15 12:09:49.740 423-454/com.xxxxxxxxxx E/Surface: getSlotFromBufferLocked: unknown buffer: 0x7f8a22e180
07-15 12:09:49.752 423-454/com.xxxxxxxxxx E/AndroidRuntime: FATAL EXCEPTION: GLThread 10571
                                                                          Process: com.redman.xxxxxxxxxx, PID: 423
                                                                          java.lang.RuntimeException: [ 1468598989710 ] - ERROR: before: glError 1281
                                                                              at com.threed.jpct.Logger.log(Logger.java:206)
                                                                              at com.threed.jpct.GL20.checkError(GL20.java:159)
                                                                              at com.threed.jpct.GL20.glGenBuffers(GL20.java:1375)
                                                                              at com.threed.jpct.CompiledInstance.compileToVBO(CompiledInstance.java:1479)
                                                                              at com.threed.jpct.CompiledInstance.render(CompiledInstance.java:607)
                                                                              at com.threed.jpct.GLRenderer.drawVertexArray(GLRenderer.java:2442)
                                                                              at com.threed.jpct.World.draw(World.java:1426)
                                                                              at com.threed.jpct.World.draw(World.java:1109)
                                                                              at com.xxxxxxxxxx.GameActivity$MyRenderer.onDrawFrame(GameActivity.java:199)
                                                                              at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1535)
                                                                              at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)


Any idea?  I've tried the current jPCT AE JAR and the beta.  Both crash on this...

Offline Redman

  • byte
  • *
  • Posts: 28
    • View Profile
Re: glError 1281 exception
« Reply #1 on: July 15, 2016, 06:22:45 pm »
Another interesting note... if I loop through rendering once (leaving it at 0,0,0), and then translate the Object3D, it does not crash.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: glError 1281 exception
« Reply #2 on: July 15, 2016, 09:20:46 pm »
1281 means "bad/invalid value". The thing is: It doesn't really happen that this stage, it just tests for it there. OpenGL doesn't report errors by itself, you have to query for them. And you can't do that after each command, because it would be too slow. So jPCT-AE does this only at a few stages and one is the buffer creation stage. The actual problem happens ealier.

I've no idea what it might have to do with the translations...but you can try to set http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Config.html#glDebugLevel to true (before creating the FrameBuffer). That will wrap the GL interface implementation into a dynamic proxy which does two things:

  • It prints out each operation
  • It will check for GL errors after each one

With that, you should be able to detect the actual cause of this.
« Last Edit: July 15, 2016, 09:22:19 pm by EgonOlsen »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: glError 1281 exception
« Reply #3 on: July 15, 2016, 09:34:26 pm »
If nothing else helps (because there's a small chance that it's a driver bug, albeit I doubt it), you can try to bravely set http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Config.html#glIgnoreErrors to true and check if your app still runs fine then.

Offline Redman

  • byte
  • *
  • Posts: 28
    • View Profile
Re: glError 1281 exception
« Reply #4 on: July 16, 2016, 01:05:50 pm »
Thank you for the prompt response!   I'll look into it and get back

Offline Redman

  • byte
  • *
  • Posts: 28
    • View Profile
Re: glError 1281 exception
« Reply #5 on: July 21, 2016, 05:09:11 pm »
I haven't forgotten to look into this!  I've just been very busy with work and haven't had free time.  I would like to figure out if there's a bug to be fixed, or if its just a driver issue