KhronosGroup / glslang

Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.
Other
2.91k stars 816 forks source link

glslangValidator formatting of warnings/errors not clickable from IDE #2717

Open alecazam opened 2 years ago

alecazam commented 2 years ago

I tried switching our codebase over to use glslangValidator from shaderc, and that broke all of our warning/error clickthrough from IDE's such as Xcode. I then noticed that shaderc reformats the warning/errors so that they are IDE friendly. Fixing this would make working on large shader codebases much more pleasant.

greg-lunarg commented 2 years ago

Could you give an example of a good shaderc message and its unfriendly glslang counterpart?

alecazam commented 2 years ago

This is how shaderc reformats the errors that it gets back. These are clickable when using absolute paths. So now I have Xcode run our make file, that calls shaderc, and shaderc dumps these out to the Xcode IDE. Then I can clickthrough to errors and warnings. We're only using shaderc now, so I don't have a glslangValidator example.

/Users/me/folder/Shaders/Sand.frag:8: error: '' : syntax error, unexpected IDENTIFIER 1 error generated.

And this is a warning. I think Xcode is producing the line/location off the warning /Users/me/folder/Shaders/Intermediate/Sand.ios.fs.metal:130:7: warning: unused function 'Foo' [-Wunused-function] float Foo(thread const float& v, thread const float& a, thread const float& b)