BabylonJS/Spector.js

SpectorJS breaks the application

wdanilo opened this issue · 6 comments

Hi, we have an app with multiple scenes. In simple scenes we have other error, but on a complex one, after pressing the "red button" in SpectorJS, I can see this in console:

CleanShot 2023-01-23 at 11 54 48@2x

We do not have any errors without running SpectorJS. I know it is hard to debug it by this description - if you want, you can test it out by compiling and running our app (got to https://github.com/enso-org/enso, switch branch to wip/wdanilo/shader-opt and then run ./run --skip-version-check gui watch --skip-wasm-opt --wasm-profile dev --crate-path ./app/gui/view/debug_scene/interface - it will compile sources and run web-browser with Spector. Is there any way I could help debugging it?

Would be great if you deploy the app somewhere ? it is really hard to clone/run locally all the projects we are troubleshooting :-(

The first warning has been fixed here d7c1910 you can try a local version of spector.

The second one for webgl should let you know what is wrong if you expand it ?

@sebavan thanks for the reply. Oh sorry, I didn't notice the second one is collapsed, as sometimes it is displayed different way in the console. The second warning is WebGL: INVALID_OPERATION: readPixels: PIXEL_PACK buffer should not be bound. Regarding hosting the app, I can give you in a few days an electron bundle of the app that you can run. Would it be OK for you?

If you can not push the version on the web, it would be ok as long as we can debug from within the app.

@sebavan sorry for making you wait! Here is the application: http://ensocdn-playground.s3-website-eu-west-1.amazonaws.com/?entry=interface (works best in Chrome) . You have to wait a few seconds for everything to load, this is a little bit heavy at the moment. I'd be very, very thankful if you'd find a moment to take a look at it. Thank you ❤️

EDIT:
There also other scenes, that are smaller, for example this: http://ensocdn-playground.s3-website-eu-west-1.amazonaws.com/?entry=text_area

You can access the list of scenes here: http://ensocdn-playground.s3-website-eu-west-1.amazonaws.com/?entry=list

About the texture not being captured, it is because you never unbind your pixel pack buffer after binding it for read.

Spector can not really do it fully safely as async op could be in progress.

You should gl.bindBuffer(WebGL2RenderingContext.PIXEL_PACK_BUFFER, null); once you are done reading data back. Agree it is not the most convenient but it should do the trick in your case.

@sebavan thank you so much for your help! It indeed fixes the issue. Thanks again a lot ❤️