GLSL - compiler not showing syntax errors?

I am making GLSL shaders and I get no errors thrown from the shader compiler after saving a shader with syntax errors in it. This is very tedious, as if the shader doesnt work, I have to manually go through the whole code to find the syntax error myself.

Is GLSL syntax checking really not supported? Or is my Unity project damaged somehow?

GLSL shaders get compiled by the driver when the application using the shader is loading it. Unity shader compiler doesn’t do error checking for shaders written in GLSL, only HLSL.

Ok, thanks for letting me know. I hope you will add proper GLSL support at some point, as it is a popular shader language.

I don’t think this is planned.
Are you trying to accomplish something that’s not possible with HLSL?
The only reason I see to use GLSL in Unity is to use something that has no support in HLSL.

I use existing GLSL libraries and code. These are quite large and complex shader applications that has thousands of lines with code, so porting them to HLSL seems to be a big job I would like to avoid if possible.

The official shader language Unity supports is HLSL wrapped in Shader Lab. GLSL and Metal shaders are supported as pass-through (i.e. the compiler doesn’t do anything (or close to that) there).
Aren’t there any GLSL to HLSL translators?

I doubt that automatic converters would work as HLSL has some fundamental differences to GLSL, such as texture samplers are using a different notation for the V component (UV coordinates in GLSL have 0 at the top and increase downwards, in HLSL 0 is at the bottom and increases upwards). Differences like this would require lots of manual work and testing.

So, since GLSL is not officially supported in Unity, could I risk that my program would fail to compile in the future, forcing me to convert the code to HLSL at some point?

Hopefully not, as I work on many other platforms where OpenGL is the main supported standard, and I’d rather keep my libraries in GLSL if possible so that they can be shared between Unity projects and my other projects.

As I said, we support pass-through GLSL shader code :slight_smile:
If this changes at some point (and I’m not aware of such plans), it will be communicated way before it happens.