Open karyon opened 8 years ago
I have the same problem. I'm using .glsl
file extensions and linting doesn't work.
What's ironic is that the image in the README is using also just the plain .glsl
there, and not any of the more specific extensions listed in the table, but it is working!
Oh, I see, _f.glsl
means is can be anything_f.glsl
(rather than ._f.glsl
), so the table is confusing, because _f.glsl
isn't specifically a "file extension" perse, it is the end of the file where the part before the extension ends in _f
and then finally the .glsl
extension.
Are you using the specific cases of .glsl
in order to highlight different things? Maybe you can also support files with any name, but using comments at the top for specifics.
// VERTEX_SHADER
void main(void) {
}
Hi @trusktr
Thanks for your comments!
The linter is an interface to the official glslangValidator tool. glslangValidator only supports *.vert|frag|geom|comp|tese|tesc file extensions so it is not possible to support files not ending with these extensions. In order to lint the other formats (.f.glsl, _f.glsl, etc) I have to generate temporary files with the officially supported extension and pass these to glslangValidator.
As to the usage of comments to differentiate between linter types, it would certainly be possible to parse the contents of the shader first, but that would involve the linter package knowing anything about the contents of glsl files which is something I want to avoid. A better place to suggest this change might be in glslangValidator itself (link to GitHub repo).
The table in the readme appears under the header 'Supported Filename Formats' rather than 'Supported filename Extensions'. I disagree that it is confusing, but I wrote it, so perhaps you can suggest how it could be improved?
-Andy
@karyon apologies for the slow response. I do agree that there is no point in the linter repeatedly telling you it can't do something, and it's on my todo list. Thank you for your patience!
Bumping because this is still a problem.
I have a shader file with the file extension
.glsl
, because there are helper functions in there that we use in various places. There are two issues: