-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GLSL Lint: Failed to spawn 'glslangValidator' binary #34
Comments
The error Your 2nd error seams that the shader stage ( What type of shader is your file |
After switching from using the Linux binary in WSL to the Windows binary I get a different error:
Along with the same map error. The file extension is .glsl -- it's a shader for the program Synesthesia. Here is the contents of it: vec2 resolution = RENDERSIZE;
vec4 fragColor = vec4(0.0);
float saturate(float x) { return clamp(x, 0, 1); }
vec3 saturate(vec3 x) { return clamp(x, 0, 1); }
vec3 hue2rgb(float h)
{
h = fract(saturate(h)) * 6 - 2;
return saturate(vec3(abs(h - 1) - 1, 2 - abs(h), 2 - abs(h - 2)));
}
vec4 renderMain(void)
{
float scale = 27.0 / resolution.y; // grid scale
vec2 area =
vec2(floor(13 / resolution.y * resolution.x), 13); // size of inner area
vec2 p0 = gl_FragCoord.xy - resolution / 2; // position (pixel)
vec2 p1 = p0 * scale; // position (grid)
// gray background with crosshair
float c1 = 1 - step(2, min(abs(p0.x), abs(p0.y))) * 0.5;
// grid lines
vec2 grid = step(scale, abs(0.5 - fract(p1 * 0.5)));
c1 = saturate(c1 + 2 - grid.x - grid.y);
// outer area checker
vec2 checker = step(0.49999, fract(floor(p1 * 0.5 + 0.5) * 0.5));
if (any(greaterThan(abs(p1), area)))
c1 = abs(checker.x - checker.y);
float corner = sqrt(8) - length(abs(p1) - area + 4); // corner circles
float circle = 12 - length(p1); // big center circle
float mask = saturate(circle / scale); // center circls mask
// grayscale bars
float bar1 = saturate(p1.y < 5 ? floor(p1.x / 4 + 3) / 5 : p1.x / 16 + 0.5);
c1 = mix(c1, bar1, mask * saturate(ceil(4 - abs(5 - p1.y))));
// basic color bars
vec3 bar2 = hue2rgb((p1.y > -5 ? floor(p1.x / 4) / 6 : p1.x / 16) + 0.5);
vec3 c2 = mix(vec3(c1), bar2, mask * saturate(ceil(4 - abs(-5 - p1.y))));
// big circle line
c2 = mix(c2, vec3(1), saturate(2 - abs(max(circle, corner)) / scale));
fragColor = vec4(c2, 1);
corner *= 0.5;
if ((_uv.x < 0.5) && (_uv.y > 0.5)) {
fragColor +=
(step(1.0 - syn_BassLevel, corner) - step(1.2 - syn_BassLevel, corner));
} else if ((_uv.x < 0.5) && (_uv.y < 0.5)) {
fragColor +=
(step(1.0 - syn_HighLevel, corner) - step(1.2 - syn_HighLevel, corner));
}
else if ((_uv.x > 0.5) && (_uv.y < 0.5)) {
fragColor +=
(step(1.0 - syn_Presence, corner) - step(1.2 - syn_Presence, corner));
}
else if ((_uv.x > 0.5) && (_uv.y > 0.5)) {
fragColor +=
(step(1.0 - syn_BPMTri2, corner) - step(1.2 - syn_BPMTri2, corner));
}
return fragColor;
}
|
If I look at your example code it looks like it is not a complete valid shader, probably a partial fragment shader, but there are some things missing like a main function: void main() {
// content of main
} Partial shader files are not supported by this extension. I have done a quick look into what Synesthesia is, it looks very interesting and it seams that it has its own shader format SSF: https://synesthesia.live/docs/creating_scenes/ssf.html which contains a fragment shader (main.glsl) file. But this is as I mentioned a partial shader file and there are some standard things like uniforms and functions injected. So it is nearly impossible to support these Synesthesia shaders, because there system is very dynamic. |
Thanks for the thorough reply; that makes total sense and I would've never figured that out by myself (new to openGL/shaders). |
I can't get it to work, yo. |
Could you describe your problem with more details, like:
|
What error happen: Using VSCode, with the extension installed, it doesn't findes the validator
Which glslangValidator version: dunno, but I downloaded from multiple GitHub repos. I guess the latest.
Example shader file which does not lint: (this is using Max 8 Jitter shader implementación)
|
This type of shader is not supported. Never see this "jittershader" thing. |
@animanoir I have created a new Issue for this, see #40 |
Hello, I am having this same issue in Ubuntu 20.04 Full path: And it does have executable permissions: The error itself is: |
This is weird. |
It works now, I don't really know what happened but it works now. Thank you for your help |
Man I've got the same problem working with VSC and Max (Jitter), u have found a solution? |
@pca-code Not yet my friend. I have worked with Max internal editor. But yeah I know we could implement this linter with Jitter, but haven't had the time. Gonna try it. |
Thank's mate, and with the Max internal editor everything is ok? Later I'm gonna try too. |
Could you double check the Unfortunately the Max Jitter shaders are not yet supported see #40 please do further discussions about Max Jitter Shaders there. |
At the moment I am on vacation and have no access to a Windows Computer, next week I will try to use a recent version of the validator from here: https://github.com/KhronosGroup/glslang/releases/tag/main-tot and look if it works. |
Has this issue found a solution yet? |
I will check this right now... |
@meiry and @dharnil-dev I have tested it right now with the recent version and it works as intended. C:\other_software\glslang\master-tot\bin>glslangValidator.exe --version
Glslang Version: 11:13.0.0
ESSL Version: OpenGL ES GLSL 3.20 glslang Khronos. 13.0.0
GLSL Version: 4.60 glslang Khronos. 13.0.0
SPIR-V Version 0x00010600, Revision 1
GLSL.std.450 Version 100, Revision 1
Khronos Tool ID 8
SPIR-V Generator Version 11
GL_KHR_vulkan_glsl version 100
ARB_GL_gl_spirv version 100 In the extension it self, I have only configured the {
//...
"glsllint.glslangValidatorPath": "C:\\other_software\\glslang\\master-tot\\bin\\glslangValidator.exe",
//...
} Everything works as intended. No errors. Neverless @meiry with your JS code I found a bug in my regex for the string literal shader detection, Only the first literal was detected with my current regex. (see: #68) |
@hsimpson Yes, that's Right. I got the same stats on this issue. I just added this line on settings.json. |
On windows, the vscode dev console log clearly shows that the extension does not correctly pick up the path: Despite the setting being set: |
You are missing the |
Oddly enough, the solution was to restart VSCode, as it seems like the extensions settings are only loaded when restarted. I falsely assumed that simply saving the settings.json file would change the config. Thank you for your help, and this great extension too! |
Yes unfortunately this feature is not implemented yet, see #21 |
Getting the following error after install all prerequisites:
GLSL Lint: Failed to spawn 'glslangValidator' binary. Error: spawn /home/lawrence/glslang/bin/glslangValidator ENOENT
I'm on Windows and have tried using the Windows binary as well as the Linux one in WSL and both give different errors with the correct path set:
"glsllint.glslangValidatorPath": "/home/lawrence/glslang/bin/glslangValidator",
Using the Windows binary gives different errors:
What gives?
The text was updated successfully, but these errors were encountered: