Re: can not create CLGLObject (random)
Posted by
Sven Gothel on
Jul 19, 2012; 1:47pm
URL: https://forum.jogamp.org/can-not-create-CLGLObject-random-tp4025227p4025592.html
On 06/16/2012 12:16 AM, The.Scotsman [via jogamp] wrote:
> Standard display() scenario:
>
> if(!sceneInitialized) {
> GL2 gl = drawable.getGL().getGL2();
> gl.glEnableClientState(GL2.GL_VERTEX_ARRAY);
> long length = buffLen * GLBuffers.SIZEOF_FLOAT;
>
> gl.glGenBuffers(1, VBOidV, 0);
> gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, VBOidV[0]);
> gl.glBufferData(GL2.GL_ARRAY_BUFFER, length, vBuff, GL2.GL_STATIC_DRAW);
>
> ...repeat for normals...
>
> gl.glDisableClientState(GL2.GL_VERTEX_ARRAY);
>
> gl.glFinish();
> System.out.println("clContext = " + clContext);
> clBuffer = clContext.createFromGLBuffer(VBOidV[0], length, CLGLBuffer.Mem.READ_ONLY);
>
> sceneInitialized = true;
> }
>
>
> The graphics for this display /beautifully/.
> However, the *createFromGLBuffer* crashes randomly.
>
> Actually, not completely randomly.
> I load a new "model" and call *canvas.display()* (i.e. repaint-on-demand)
> *clContext* does not change.
> *createFromGLBuffer* throws an exception about 2/3 the time.
>
> com.jogamp.opencl.CLException$CLInvalidGLObjectException: can not create CLGLObject from #1 [error: CL_INVALID_GL_OBJECT]
>
>
> This seems like some kind of timing/threading problem.
> (*canvas.display()* appears to be threaded)
>
> The jogamp use guide isn't much help here - the section under "AWT
> Multithreading Issues" starts with "Below statements incorrect!"
>
> Any clue as to how to approach this?
Could be related to:
http://forum.jogamp.org/stuck-in-Processing-with-with-any-JOGL-release-RC6-Mac-tp4025519p4025528.htmlhttps://jogamp.org/bugzilla/show_bug.cgi?id=606Will take care of this tomorrow.
Pls track the above bug report.
When I claim it fixed, pls retest and reply.
~Sven
> Thanks.
>