Shader not compiling on mac but will on windows


I wrote a fragment shader on my windows machine and it worked fine. But when I try to build it on my late 2012 macbook pro i get the following errors.

Incompatible types in initialization (and no available implicit conversion)

Is this a result from the version differences of OpenGL? Is there a way to force to a specific version of OpenGL?


It’s said that apple will drop opengl?


Do you get a line number as well? Did you search for the error? Maybe this will help:


Yes, that is true, but not for quite some time. We’re working on a Metal compatible render pipeline.


The shader compiler on mac may be more picky than the one on windows. Please post the log that contains the error, there should be a line number to the offending code.


One common mistake is assigning an int to a float lvalue in GLSL:

float a = 1.0; // OK
int b = 1; // OK
float c = 1; // Wrong

But yeah, look at the code at the line number reported by the error.


All my shaders written on a Mac, work on Windows. So Windows is more permissive in your case.


Thank you for the reply it did give me a line number. I dont have my laptop with me this morning but ill post it all latter today.

Thank you, I will later today.

I see. If I remember correctly my code is written correctly as you show it.