WebXR-emulator-extension icon indicating copy to clipboard operation
WebXR-emulator-extension copied to clipboard

Crash on context lost when in `immersive-vr` session

Open hansagames opened this issue 3 years ago • 0 comments

Hi,

was trying to simulate context lost scenario during immersive-vr mode and got crash in extension code.

VM14:36592 Uncaught TypeError: Cannot read properties of null (reading '0')
    at EmulatedXRDevice.onFrameStart (<anonymous>:36592:59)
    at XRSession$1.<computed>.onDeviceFrame (<anonymous>:1275:46)
    at wrapper ((index):8876)

code to simulate context lost scenario

gl.getExtension("WEBGL_lose_context").loseContext();

// I add 1 sec between these calls to simulate real context switch
gl.getExtension("WEBGL_lose_context").restoreContext();

I dont have real device at the moment so can not say what will happen there, will try to check next week. But as I know its possible to lose webgl context during vr so should be handled on app side and restore game / end session when that happens.

there is check

Anyone have experience with this ?

thank you

hansagames avatar Sep 24 '21 08:09 hansagames