danielscherzer / GLSL

VSIX Project that provides GLSL language integration.
257 stars 28 forks source link

Minor compiler error? #128

Closed MV10 closed 4 months ago

MV10 commented 4 months ago

Is this the right place to report compiler errors?

Anyway... VS2022 17.9.6 and extension version 0.11.174, it appears that a double-slash comment that isn't followed by a space is marked as an error, but that might be a fluke, which I'll explain. (Also this problem isn't a big deal to me, it's something I noticed in passing, this file compiles and runs fine "for real" outside the editor.)

image

Add a space after the slash and it goes away.

image

I say it might not be the actual problem because it also seems to introduce bizarre incorrect error messages later in the file, like this one (the fre variable is defined, and the earlier tx2 error wouldn't have some downstream impact; fre has no dependency on tx2 up to that point; also fre is used a couple times in lines preceding this one, which are not marked as errors):

image

I was going to post one big screenshot showing both of those in view at the same time, and to make it reasonable-sized, I was going to delete a bunch of large comment blocks in the middle -- but as I start messing with those blocks, one or both of the errors disappear. So I'm not entirely sure my assumption is right that // without a space is actually the problem.

If you want to play around with the file, you can get it here:

https://github.com/MV10/volts-laboratory/blob/master/shaders/disco_tunnel.frag

It hasn't changed in a long time, and is unlikely to change again any time soon. For me, lines 290 and 317 are marked as errors.

danielscherzer commented 4 months ago

I can confirm this behaviour with the NVDIA driver GLSL compiler and glslang.exe as external compiler. I only show these compiler warnings in the extensions. So no I cannot do anything about wrong compiler errors.

My guess is that the ambiguity between an one-line comment // and a multi-line comment /* causes this. Maybe the WebGL compiler for GLSL does not share this trait.

MV10 commented 4 months ago

Ok I'll close this, I wasn't clear about what is actually doing the compiles in the IDE vs actual execution. Thanks!