cancel
Showing results for 
Search instead for 
Did you mean: 

My integration crashes in wglShareLists() and nvoglv32.dll

Vrally
Protege
Hi,

I have successfully integrated Oculus with OpenSceneGraph by doing Client distortion rendering. But I would like to support SDK distortion rendering as this is the recommended path by Oculus. This has proved a lot more difficult than I first believed and I have spent an insane amount of time trying to find why I cannot get this to work.

OpenSceneGraph is a high level layer built on top of OpenGL. It uses lazy initialization which results in contexts and textures not being created until the window is realized and the rendering loop starts. I have used some tricks to force the window to open and textures being initialized before calling ovrHmd_ConfigureRendering(). But I really can't get this to work.

I get crashes in my application every time, but the location of the crash changes from time to time. Most often I hit the assert in the CreateShared() function inside CAPI_GL_Util.cpp. The following function returns false which triggers the assert:
BOOL success = wglShareLists(ctx.systemContext, systemContext );
OVR_ASSERT( success == TRUE );


Other times I get crashes deep inside the nvidia driver, aka a stack trace containing:

nvoglv32.dll!691da0c7() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for nvoglv32.dll]
nvoglv32.dll!697292d5() Unknown
nvoglv32.dll!697b7c9e() Unknown
nvoglv32.dll!6971ff6a() Unknown
nvoglv32.dll!69869651() Unknown
nvoglv32.dll!698b6d3f() Unknown
nvoglv32.dll!699b838e() Unknown
[External Code]


I have tried to compare my application with the OculusWorldDemo and comparing the contents of the struct ovrGLConfig which is sent into the ovrHmd_ConfigureRendering() function. And the content seems to be the same.

I would be very thankful if anyone could give me some hints why my integration keeps crashing. Or at least explain why the wglShareLists() function always fail in my case?
2 REPLIES 2

Vrally
Protege
I have tried to debug further during the day. And I the reason for me getting the assert is that the function Context::InitFromCurrent() in CAPI_GL_Util.cpp returns null for both hdc and systemContext during the ovrHmd_EndFrame() call:


hdc = wglGetCurrentDC();
systemContext = wglGetCurrentContext();


wglGetCurrentDC should return a pointer to the context of the calling thread. Since we are running this from HSWDisplay::RenderInternal() function which handles the distortion rendering I guess there has to be something wrong with the context connected to the textures.

Rajveer
Explorer
I had (have) a similar problem. When my engine activates a GL context for a window, it does the following:

HDC deviceContext = GetDC(hWnd);
wglMakeCurrent(deviceContext, renderContext);
ReleaseDC(hWnd, deviceContext);


which results in the

HDC hdc = wglGetCurrentDC();


lines in the SDK failing to get the device context and therefore creating a render context later. Removing the ReleaseDC() function call results in the SDK being able to get a valid handle to the active DC, so it looks like releasing the DC will have to be done after the SDK has done what it needs to do. Maybe you're running in to something similar?
Still need help?

Did this answer your question? If it didn’t, use our search to find other topics or create your own and other members of the community will help out.

If you need an agent to help with your Meta device, please contact our store support team here.

Having trouble with a Facebook or Instagram account? The best place to go for help with those accounts is the Facebook Help Center or the Instagram Help Center. This community can't help with those accounts.

Check out some popular posts here:

Getting Help from the Meta Quest Community

Tips and Tricks: Charging your Meta Quest Headset

Tips and Tricks: Help with Pairing your Meta Quest

Trouble With Facebook/Instagram Accounts?