Open Martomate opened 1 year ago
If multiple shader stages in the same file is not supported
The plugin does not care about shader stages, the problem is that the plugin always processes both branches of the #if. This is not trivial to fix (at least for me) because of the fairly complex interactions between the preprocessor and the lexer. Basically the code is parsed as if the #if-else was not there.
PR's welcome.
Describe the bug When a variable is defined multiple times in a file the first definition seems to be used for type checking. This can be a problem if multiple shader stages are written in the same file.
To Reproduce
Expected behavior Ideally there would be no complaints from Intellij for the above code.
If multiple shader stages in the same file is not supported, then I could of course put in them in separate files instead, or use another name for the variable. It would be a reasonable workaround for now.
Versions
Extra context My real code uses
#pragma shader vert
instead of#if
, but I found that both versions had the same problem.