stevensona/shader-toy

Preview not working on Linux

smoothstacks opened this issue · 8 comments

Awesome extension, works great on Windows. Getting the following error trying to open one of the demo shaders on Linux.

[Embedded Page] Uncaught TypeError: Cannot read property 'getExtension' of null

Pause button and frame time show up, but no shader view.

This on Linux Deepin 15.8.
VSCode version info:
Version: 1.29.1
Commit: bc24f98b5f70467bc689abf41cc5550ca637088e
Date: 2018-11-15T19:07:43.495Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64

Thanks for reporting that issue @jhodgson91, it'd be amazing to get the extension working on all platforms!

This sounds like a problem with three.js or webgl itself, I'll need to look into that. Gonna have to setup a VM and all that, so I don't think it'll happen before the weekend.

One thing you can check for us is weather your GPU supports WebGL (I'd be surprised if not, but you never know). If it's the same machine that you are running Windows on, then that can be excluded as the cause of course.

Hey, yeah can confirm its not a graphics card issue. It does work on my windows boot. It does work in Chrome, shadertoy and a quick test I wrote myself both get a webgl context. So beginning to think it's something to do with electron and the webview stuff. My knowledge ends there unfortunately haha.

Let me know if I can help out at all.

@jhodgson91 Are you, by any chance, inadvertently or not, running code with --disable-gpu flag?

@stevensona - no I wasn't, but this did highlight the --verbose option and I spotted the issue.

Turns out it was failing to find libGLESv2.so. For me this was in /opt/google/chrome/swiftshader, but it was looking for it in /usr/share/code/swiftshader which didn't exist. Adding a symlink fixed it. Not sure why my vscode was missing this, but this doesn't seem like an issue with the extension, rather my setup.

Thanks all!

@jhodgson91 Well spotted :)
I did just set up a VM earlier, running Deepin 15.7 and had in fact the same issue. I'm not very experienced with Linux, so can you make a guess if this issue is related to VSCode or Electron or Deepin or its package installer? Then maybe we can consider directing the issue to the right channel.

@Malacath-92 - my first guess would be the package installation. I'd be interested to see if this happens with any other Debian based distros. I'll give it a try with Ubuntu when I get a chance.

@Malacath-92 - tested it on Ubuntu 18.04 and got the same issue, so yeah looks like installing vscode on any debian distros will have this problem.

@jhodgson91 That's unfortunate. Thanks for taking the time to investigate it!
I will try to take a closer look at this during the weekend/next week, and see if the guys at vscode/electron know anything about it.

Edit: I'm sorry I sometimes reply with my work account without noticing, but the resemblance is uncanny either way