My fragment shader has a bunch of shaders (one for each light, plus a main one) that are compiled separately and linked together. This setup makes sense to me, because if the light configuration changes, I usually don’t have to recompile all the shaders, just some of them. But with a certain Nvidia driver, I get an error,
error C1002: the name “ECPos3” is already defined
complaining about a varying variable that is used in more than one of the shaders.
Would it be safer, if a little less efficient, to just glob all the shader code together and compile it all at once? Or is there another workaround?