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

Viewed 2536

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?

3 Answers

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.

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.

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".

Related