Error WebCL inside Unigine

221 views
Skip to first unread message

wolfviking0

unread,
May 7, 2013, 4:58:17 AM5/7/13
to emscripte...@googlegroups.com
Hi,

I want to rebuild the last version of Unigine with the last incoming but unfortunately i have a new error, i will search why i have this problem but may be somebody have an idea.

WebConsole Firefox
--
[10:08:27,987] Error: WebGL: vertexAttribPointer: must have valid GL_ARRAY_BUFFER binding @ file:///Users/wolfviking/Desktop/WebGL/html/js/allengine.js:10829
[10:08:27,987] TypeError: GL.immediate.clientAttributes[GL.immediate.VERTEX] is undefined @ file:///Users/wolfviking/Desktop/WebGL/html/js/allengine.js:8259

WebConsole WebKit
[Warning] WebGL: INVALID_OPERATION: vertexAttribPointer: no bound ARRAY_BUFFER (index.html, line 0, x3)
[Error] TypeError: 'undefined' is not an object (evaluating 'GL.immediate.clientAttributes[GL.immediate.VERTEX].size')
createRenderer (allengine.js, line 8259)
getRenderer (allengine.js, line 8246)
flush (allengine.js, line 8641)
_glDrawElements (allengine.js, line 8531)
__ZN7GLESFfp16render_trianglesEPN3Ffp6VertexEiPti (allengine.js, line 18558)
__ZN3Gui6renderEiiii (allengine.js, line 18564)
__ZN7GLESGui6renderEiiii (allengine.js, line 18558)
__ZN6Engine9do_renderEv (allengine.js, line 18556)
__ZL18engine_render_funcv (allengine.js, line 18556)
__ZN3App6renderEv (allengine.js, line 18561)
__ZN10GLESAppSDL8doRenderEv (allengine.js, line 18568)
__ZN7Unigine10AppWrapper8doRenderEv (allengine.js, line 18557)
__ZNK7Unigine15EngineInterface6renderEv (allengine.js, line 18557)
__Z6updatev (allengine.js, line 18568)
dynCall (allengine.js, line 309)
runner (allengine.js, line 12209)

I have a suggestion will be interesting to add some tools like https://github.com/greggman/webgl-capture for can't make small test case. If i understand well how that work, the tools grab only the webcl call for extract the webcl part and i think could be useful.Like that is not necessary send the 150Mo of an complete engine for test case when only the stack of webcl call.

wolfviking0

unread,
May 7, 2013, 2:20:11 PM5/7/13
to emscripte...@googlegroups.com
Oupsss, i just see i make a mistake inside the title topic is not WebCL error but WebGL ....

Alon Zakai

unread,
May 8, 2013, 8:30:08 PM5/8/13
to emscripte...@googlegroups.com
There is a WebGL inspector tool that might help with stuff like this.

I don't have an idea offhand what could cause this. Bisecting to find the revision where this changed in emscripten could help, unless this just happened with a new version of Unigine, that was never known to work (sounds like that's the case)?

The stack trace indicates it is using GL emulation. Is Unigine not using ES2?

- Alon



--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

wolfviking0

unread,
May 9, 2013, 4:55:31 AM5/9/13
to emscripte...@googlegroups.com
Hi Alon,

It´s weird because i build Unigine without OpenGL api, only opengles and In the stack we see it´s call GLESFfp, who is part of opengles render of Unigine.

Anyway, i will double check this, and i will try to see when the problem appear.

Tony

Alon Zakai

unread,
May 9, 2013, 2:28:04 PM5/9/13
to emscripte...@googlegroups.com
It should be easy to see why the GL emulation code is even being included. You can see in src/jsifier.js addFromLibrary where it pulls in code from the JS libraries. Printing out stuff there might help see what is going on. Or, you can look in the .ll for the "declare" lines, that are external symbols that will be pulled in from a library. Perhaps there is something like glBegin that is compiled in, and forces us to include all of GLEmulation.

- Alon



wolfviking0

unread,
May 17, 2013, 10:08:28 AM5/17/13
to emscripte...@googlegroups.com
Hi Alon,

I do some search about my problem wit GL Emulation, i put some log inside jsfier and i m not sure what i must look. I print ident inside addFromLibrary but not sure if is the right thing ...
Anyway i have some call to GLEmulation

--> [object Object] - glGenVertexArrays
--> [object Object] - $GLEMulation
--> [object Object] - glDeleteVertexArraysOES

--> [object Object] - $GL
--> [object Object] - $GLImmediateSetup
--> [object Object] - $GLEmulation
--> [object Object] - glPushMatrix

--> [object Object] - glGenVertexArrays
--> [object Object] - $GLEMulation
--> [object Object] - glDeleteVertexArrays

--> [object Object] - glGenVertexArrays
--> [object Object] - $GLEMulation
--> [object Object] - glDeleteVertexArrays

I try looking inside .ll but there are a lot of "declare".

Not sure what i must do :(



Alon Zakai

unread,
May 21, 2013, 3:31:20 PM5/21/13
to emscripte...@googlegroups.com
First grep the declares from the .ll.

Then we can see which of those causes $GLEmulation to be included. Looking in library_gl.js, I see that the entries that cause that are

$GLImmediate, glVertexPointer, glGenVertexArrays, glMatrixMode

If none of the last three exist in your .ll, then it must be the first, whose deps are

glBegin, glLoadIdentity

- Alon




Mark Callow

unread,
May 21, 2013, 9:57:59 PM5/21/13
to emscripte...@googlegroups.com, Alon Zakai
Hi,

I'm not sure that providing emulation of glBegin, etc. is really a useful service. Emulating these functions on WebGL, which can only source vertex attributes from server-side (GL-side) buffer objects, is not likely to have good performance. Native OpenGL {,ES} is also moving away from client-side arrays, which would otherwise be the emulation strategy of choice for native.

It might be better in the long run if lack of emulation forced people to change their code to the new style.

Regards

    -Mark

wolfviking0

unread,
May 22, 2013, 4:10:53 AM5/22/13
to emscripte...@googlegroups.com

I Alon, i do the grep of my .ll file inside the tmp folder but not found one of this function.

But searching in the entire source of Unigine i found only one similar may be it's that  


// OES vertex array object

extern PFNGLGENVERTEXARRAYSOESPROC glGenVertexArraysOES;


// OES vertex array object

PFNGLGENVERTEXARRAYSOESPROC glGenVertexArraysOES = NULL;


// OES vertex array object

GET_PROC_ADDRESS(glGenVertexArraysOES)


it's the only thing i found ....




declaregrep.txt

Alon Zakai

unread,
May 22, 2013, 6:59:34 PM5/22/13
to emscripte...@googlegroups.com
we recommend using the WebGL-friendly subset of GL, that requires no emulation. But we do support emulating GL ES and some older GL stuff for legacy code. It helped with the BananaBread demo for example, which otherwise would have required a lot more work.

- Alon



--

Alon Zakai

unread,
May 22, 2013, 9:06:00 PM5/22/13
to emscripte...@googlegroups.com
Thanks, I tested with that grep output and I can see that in fact GLEmulation is included. Looks like the reason is that SDL_GL_GetProcAddress appears in the project. It should not be needed for OpenGL ES 2.0, I believe?

- Alon


wolfviking0

unread,
May 23, 2013, 3:53:10 AM5/23/13
to emscripte...@googlegroups.com
Hi Alon,

Unigine use glGetProcAddress for load extension like : ARB draw buffer / OES map buffer / OES vertex array object / OES texture 3D
I remove this code part but i still have an error 

--
[09:45:53,784] Error: WebGL: vertexAttribPointer: must have valid GL_ARRAY_BUFFER binding @ file:///Users/wolfviking0/Desktop/WebGL/html/js/allengine.js:7666
[09:45:53,784] Error: WebGL: drawElements: must have element array buffer binding @ file:///Users/wolfviking0/Desktop/WebGL/html/js/allengine.js:7669


 - Tony
Reply all
Reply to author
Forward
0 new messages