What is the correct way to set the Glsland Validator Path on the GLSL Lint extension for VSCode on Windows (using WSL)
Asked Answered
G

4

7

Trying to play around with shaders on the browser and just installed the GLSL Lint extension for VSCode, which apparently needs to know the path to a glslangValidator binary before working properly.

Said binary can (I'm assuming) be found here: https://github.com/KhronosGroup/glslang/releases/tag/master-tot

However, I've already tried multiple combinations of installation paths, both within Linux and Windows, to no avail: the extension keeps spewing an ENOENT error as can be seen in the picture below:

enter image description here

Considering my setup (Using VS Code on Windows with WSL), where exactly should I place this binary file so that GLSL Lint can properly find it?

I tried, for example, both ~/glslang/bin/glslangValidator and C:\\Users\\{User}\\AppData\\Local\\Packages\\TheDebianProject.DebianGNULinux_31v5hhsz12ds6\\LocalState\\rootfs\\home\\glslang\\bin\\glslangValidator (among other installation paths), but so far none worked.

What am I missing?

Germany answered 23/9, 2020 at 19:16 Comment(2)
I'm getting the same problem, did you ever get this to work?Overshine
Nevermind, I figured it out, check my answer below.Overshine
O
8

I just figured it out--the problem is that using VSCode with WSL will change the file system that the path should be written in. Instead of downloading the windows binary glslangValidator.exe, you should download the linux binary glslangValidator. Check this link and copy the url of the latest release, then download it like so:

cd ~ # Or wherever you want it
wget https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-linux-Release.zip
unzip glslang-master-linux-Release.zip -d glslang

Then, you need to set the glslangValidatorPath to the WSL path:

"glsllint.glslangValidatorPath": "/home/<username>/glslang/bin/glslangValidator"

*Of course, replace <username> with your username, and if you installed it in a different directory, use that path instead.

Overshine answered 13/2, 2021 at 19:38 Comment(0)
V
3

I'm using Windows and installed glslang in my root path. After that I set the path parameter like this and it worked:

"glsllint.glslangValidatorPath": "C:/glslang/bin/glslangValidator.exe"

Alternatively, you could add C:/glslang/bin to your PATH variable.

Vivien answered 7/10, 2020 at 9:18 Comment(1)
I tried that and still get the same error: GLSL Lint: Failed to spawn 'glslangValidator' binary. Error: spawn C:/glslang/bin/glslangValidator.exe ENOENT. The file is there, mind you (you're just gonna have to trust me on this one).Germany
O
1

I just ran into this issue, but am not using WSL like the accepted answer.

What worked for me was actually really dumb: the GLSL Lint error is that it failed to spawn the process, not just failed to find. If you download the file from the link in the OP and update glsllint.glslangValidatorPath in Settings, GLSL Lint will find the file, but still fail to execute it... because Windows Defender is blocking the exe you downloaded.

Simply running the exe manually via double-click and choosing "Run anyway" whitelisted the program, allowing GLSL Lint to run it. You need to restart VSCode after this, and then it will no longer be an issue.

Outsider answered 22/2, 2024 at 1:8 Comment(0)
W
0

I am using Windows The following helped me: change the extension of the vertex shader file to ".vert" and the extension of the fragment shader file to ".frag".

Wanids answered 27/3, 2021 at 14:26 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.