What could make wglMakeCurrent awfully slow?

NeARAZ

Newcomer
The short question is: profiling tells that wglMakeCurrent takes ages (like 10ms each) under some conditions that we don't control (in a browser plugin). What could cause it behave so? This is on various graphics cards from different vendors.

The long story: we make a web plugin for playing 3D content. It works ok in Internet Explorer; however on Firefox wglMakeCurrent is awfully slow. Exactly the same plugin works on Opera ok, so there must be something funky in Firefox that causes the slowdown. I've been wrestling this for months now and am starting to get desperate, with Firefox guys being silent and hardware guys saying "it's a firefox problem!". However, when someone views slow stuff in our plugin, they surely won't start blaming Firefox, it's our plugin that is the first to blame.

Here's a minimal repro case: http://unity3d.com/aras/firefox_slow/WebPluginGLTest.zip (244KB) - basically the minimal plugins for IE (ActiveX) and Firefox (NPAPI) that do nothing, just 10 wglMakeCurrent calls each frame, clear and swap buffers. The instructions are in readme.txt file inside, along with full source code and compiled versions.

I've seen machines that are not slow in Firefox; but most I've tried are slow (both Firefox 1.5 and 2.0; graphics cards like GeForce 6800/7600, Radeon 9600/X1600, Intel integrated etc).

Did anyone else have experience with wglMakeCurrent being slow? Under what conditions it is? I know that some close-to-hardware guys hang around here in b3d forums, hence my hope in posting this :)
 
I am not sure if this helps.

wglMakeCurrent flush the current context before it change it. Have you try to flush before calling wglMakeCurrent? Only to make sure it is not something else that is still pipelined.
 
Yes, I have tried that (did not help).

Besides that, there's not that much stuff to pipeline when I only do wglMakeCurrent, glClear and SwapBuffers, right? (the repro case I linked to does just that)
 
Back
Top